package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PostCommentsMapper;
import com.ruoyi.system.domain.PostComments;
import com.ruoyi.system.service.IPostCommentsService;

/**
 * 帖子评论Service业务层处理
 * 
 * @author zrj
 * @date 2025-07-15
 */
@Service
public class PostCommentsServiceImpl implements IPostCommentsService 
{
    @Autowired
    private PostCommentsMapper postCommentsMapper;

    /**
     * 查询帖子评论
     * 
     * @param postCommentId 帖子评论主键
     * @return 帖子评论
     */
    @Override
    public PostComments selectPostCommentsByPostCommentId(Long postCommentId)
    {
        return postCommentsMapper.selectPostCommentsByPostCommentId(postCommentId);
    }

    /**
     * 查询帖子评论列表
     * 
     * @param postComments 帖子评论
     * @return 帖子评论
     */
    @Override
    public List<PostComments> selectPostCommentsList(PostComments postComments)
    {
        return postCommentsMapper.selectPostCommentsList(postComments);
    }

    /**
     * 新增帖子评论
     * 
     * @param postComments 帖子评论
     * @return 结果
     */
    @Override
    public int insertPostComments(PostComments postComments)
    {
        postComments.setCreateTime(DateUtils.getNowDate());
        return postCommentsMapper.insertPostComments(postComments);
    }

    /**
     * 修改帖子评论
     * 
     * @param postComments 帖子评论
     * @return 结果
     */
    @Override
    public int updatePostComments(PostComments postComments)
    {
        postComments.setUpdateTime(DateUtils.getNowDate());
        return postCommentsMapper.updatePostComments(postComments);
    }

    /**
     * 批量删除帖子评论
     * 
     * @param postCommentIds 需要删除的帖子评论主键
     * @return 结果
     */
    @Override
    public int deletePostCommentsByPostCommentIds(Long[] postCommentIds)
    {
        return postCommentsMapper.deletePostCommentsByPostCommentIds(postCommentIds);
    }

    /**
     * 删除帖子评论信息
     * 
     * @param postCommentId 帖子评论主键
     * @return 结果
     */
    @Override
    public int deletePostCommentsByPostCommentId(Long postCommentId)
    {
        return postCommentsMapper.deletePostCommentsByPostCommentId(postCommentId);
    }
}
